package com.huawei.crm.shiro;

import com.jagregory.shiro.freemarker.ShiroTags;
import freemarker.template.Configuration;
import freemarker.template.TemplateException;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.io.IOException;

public class CRMFreeMarkerConfigurer extends FreeMarkerConfigurer {

    public void afterPropertiesSet() throws IOException, TemplateException {

        // 继承之前的属性配置,不能省略
        super.afterPropertiesSet();
        Configuration cfg = this.getConfiguration();
        cfg.setSharedVariable("shiro", new ShiroTags());//shiro标签
    }
}
